/**
 * 
 * 这个是侯卓的写的下拉组件
 * 
 * 
 * 电话：13548192078
 * 
 * 
 * 邮箱：330689855@qq.com
 * 
 * 
 * 使用方法：
 * 
 *    后台数据格式为：{limit:20,start:1,count:100,result:[这里就是哪个list]};
 * 
 * 
 *  
 	var opts1 =	$("#testInput").houzhuoSelect({
		selectId:'testInput',  //input 的ID
	    width:600,   //input width
		height:300, 
		single:true,   //input 是单选，还是多选
		idFiled:"table_id",  //需要利用的Id字段名称  必须设置
	 	nameFiled:"content",  //需要使用数据的显示名称  必须设置
	 	showFiled:{
				 		filed:["table_id","content","name"],
				 		filedTitle:["主键Id","内容","名称"]
				 	}, //需要使用数据源的所有字段名称  必须设置
	 	dataUrl:"${pageContext.request.contextPath}/demo.do",  //加载数据的URL格式如上： 必须设置
		page:true,//是否显示分页
		tree:true, //内容是否是个树 ,有树的时候分页没有作用
		treesetting:{},//此treesetting完全继承ztree的setting设置
		panelpostion:"down", //div现在的位置在input上面还是下面  up表示放上面
		valueData:[{table_id:"1",content:"夺地",name:"张三"}],//默认显示的数据源
		param:{
			start:1,
			limit:20,
			count:0,
			inputValue:"",
			shearchValue:''
			
		}, //向后台传的参数  必须设置
		before:function(opts){
			//调用成功数据之前
		},
		success:function(opts) {
			// alert("d");
		},submit:function(opts){
		   //选中值后调用些方法
		}
		
		
	});

     
    
	$("#bt1").click(function(){ 
		var array = $("#testInput").houzhuoSelect("getValues","testInput");
		//console.log(array); 
	}); 
 * 
 * 
 * 
 * @returns
 */

(function(){
	//得到当前页面最大z-index
	function getMaxZIndex() {
	    var maxZ = Math.max.apply(null, 
	    　　$.map($('body *'), function(e,n) {
	      　　	if ($(e).css('position') != 'static'){
	    	  		return parseInt($(e).css('z-index')) || -1;
	      　　	}
	    }));
	    return maxZ;
	} 
	//控制显影的问题
	function loadShowHide(testinput,divContent,opts){ 
		//点击就显示事件 
		testinput.click({name:opts},function(e){
			var opts  = e.data.name;
			var testinput = $("#"+opts.selectId); 
			var offset = testinput.offset();
			var inputHeight = testinput.height();
			var left=offset.left;
			var top=offset.top+inputHeight+8;
			if(opts.panelpostion == "up"){
				top=offset.top-opts.height-4;
			}
			divContent.css({"left":left,"top":top});
			divContent.show();
			$(document).unbind();// 这三个事件，是因为在bootstartp中model弹窗组件得到焦点和下面的input焦点事件起了冲突而造成的。所有加这三句话
			$("script").unbind();//
			$(window).unbind();//
		});
		testinput.focusout(function(){
			divContent.hide();
		});
		testinput.focusin(function(){
			divContent.show();
		}); 
		
		divContent.mouseenter(function(){
			
			testinput.unbind("focusout");
		});
		divContent.mouseout(function(){
			
			testinput.focus();
			testinput.focusout(function(){
				divContent.hide();
			}); 
		}).mouseover(function(){
			
			testinput.unbind("focusout");
		});
		 
		divContent.click(function(e){ 
			testinput.focusout(function(){
				divContent.hide();
			});
			e.stopPropagation();
		});
		
		testinput.keyup({name:opts},function(e){ 
			if(e.keyCode ==13){ 
				loadWebData(e.data.name);
				showData(e.data.name);
			} 
		});
	 
	} 
	//init
	function init(opts){
		opts.before(opts);
		var testinput = $("#"+opts.selectId); 
		var offset = testinput.offset();
		var divContent;
		if($("#"+opts.selectId+"divcontent").length>0){
			divContent = $("#"+opts.selectId+"divcontent");
		}else{
			var divContent = $("<div/>");
			divContent.attr("id",opts.selectId+"divcontent");
		} 
		divContent.html("");
		opts.divContent=divContent;//记住div
		var inputwidth = opts.width;
			if(opts.width==0){
				inputwidth = testinput.width()+4;
			}  
		var inputHeight = testinput.height();
		var left=offset.left;
		var top=offset.top+inputHeight+8;
		if(opts.panelpostion == "up"){
			top=offset.top-opts.height-4;
		} 
		var maxindex =getMaxZIndex()+1;
		var divContentHeight = 200;
			divContent.css({"position": "absolute","left":left,"top":top,"width":inputwidth,"background":"#f4f4f4","z-index":maxindex,"height":opts.height+"px","border":"1px solid #666666","overflow-y":"auto","overflow-x":"hidden"});
			//divContent.attr("tabindex","1");
			$("body").append(divContent);
		var content1 =$("<div/>");content1.attr("id",opts.selectId+"_divtop");
		var content1_5 =$("<div/>");content1_5.attr("id",opts.selectId+"_divcenter");
		var content2 =$("<div/>");content2.attr("id",opts.selectId+"_divbuttom");
			content1.css({"width":inputwidth,"background":"#f4f4f4","z-index":maxindex,"min-height":"50px","float":'left'});
			content1_5.css({"width":inputwidth,"background":"#f4f4f4","z-index":maxindex,"min-height":"30px","float":'left'});
			content2.css({"min-width":inputwidth,"background":"#EEEEEE","z-index":maxindex,"overflow":"auto","float":'left'});
			divContent.append(content1);
			divContent.append(content1_5);
			divContent.append(content2); 
			opts.content1=content1;//记住div1
			opts.content2=content2;//记住div2
	 	var buttonsubmit = $("<div/>");
	 		buttonsubmit.css({"line-height":"25px","float":"right","font-size":"12px","text-align":"center","background":"#5BC0DE","width":"60px","margin-right":"25px","height":"25px","cursor ":"hand"});
	 		buttonsubmit.text("确认");
			if(opts.single == true){
				content1.hide();
				content1_5.hide();
				content2.height(divContent.height());
			}else{
				content1_5.append(buttonsubmit);
				buttonsubmit.click({name:opts},function(e){
					//alert(2);
					e.stopPropagation();
					showTextValue(e.data.name);
					$("#"+e.data.name.selectId).unbind();
					e.data.name.divContent.unbind();
					e.data.name.divContent.hide();  
					setTimeout(function(){
						loadShowHide($("#"+e.data.name.selectId),e.data.name.divContent,e.data.name);
					},1000); 
					opts.submit(opts); 
				});
			}
			loadShowHide(testinput,divContent,opts);
			loadWebData(opts);
			showData(opts); 
			setData(opts);
			divContent.hide();
			loadSucessTrColor(opts);
			opts.success(opts);
			return opts;
	};
	
	//初始化就有值的
	function setData(opts){ 
		
		if(opts.single == true && opts.valueData.length>0){ 
			$("#"+opts.selectId).data("data",opts.valueData);
			//console.log(opts.valueData[0][opts.nameFiled]);
			$("#"+opts.selectId).val(opts.valueData[0][opts.nameFiled]);
		}else{ 
			showContent1(opts);
			showTextValue(opts);
		}
		$("#"+opts.selectId).data("data",opts.valueData);
	}
	//加载后台数据
	function loadWebData(opts){
		opts.param.inputValue = $("#"+opts.selectId).val();
		var shearchValue = $("#"+opts.selectId+"_gridselect").val();
		if(null ==shearchValue || shearchValue =="undefined"){
			opts.param.shearchValue  = ""; 
		}else{
			opts.param.shearchValue  = shearchValue;
		} 
		$.ajax({
		   type: opts.type,
		   url: opts.dataUrl,
		   data: opts.param,
		   dataType:"json",
		   async:false,
		   success: function(msg){
			   //console.log("下拉组件加载后台数据成功" +msg.result.length);
			   opts.data = msg; 
			   //如果数据结果大于0,则当前一个对，则要对比当中哪些树的节点选中
			   if(opts.data.result.length>0 && opts.tree == true){ 
				   for(var i=0;i<opts.data.result.length;i++){
					   var t1 = opts.data.result[i][opts.idFiled];
					   for(var j=0;j<opts.valueData.length;j++){
						   if(t1 ==opts.valueData[j][opts.idFiled]){
							   opts.data.result[i].checked =true;
							   continue;
						   }
					   }
				   } 
			   }
			   
		   },error:function(XMLHttpRequest, textStatus, errorThrown){
			   ////console.log("下拉组件加载后台数据报错"+textStatus);
		   }
		});
	};
	
	//显示数据
	function showData(opts){ 
		var _gridselect = $("#"+opts.selectId+"_gridselect").val();
		if(_gridselect=="undefined" || null ==_gridselect){
			_gridselect="";
		}else{
			_gridselect = opts.param.shearchValue;
		}
		//分页层，如果层在就得到，如果不在就新
		var cl ;
		if($("#"+opts.selectId+"pagediv").length>0){
			cl = $("#"+opts.selectId+"pagediv");
		}else{
			cl =pagediv.clone();
			cl.attr("id",opts.selectId+"pagediv");	
		} 
		opts.content2.html("");
		//如果是一个树
		if(opts.tree == true){  
			if(opts.single == true){
				treesetting.check.enable = false;
			}else{
				treesetting.check.enable = true;
			}
			if(opts.data.result && opts.data.result.length>0){
				var tree = $('<ul id="'+opts.selectId+'_tree" class="ztree"></ul>');
				opts.content2.append(tree);
				//console.log(opts.data.result);
				$.fn.zTree.init($("#"+opts.selectId+"_tree"), opts.treesetting, opts.data.result);
				$("#"+opts.selectId+"_tree").data("opts",opts);
			}
			return;
		} 
		if(opts.data.result && opts.data.result.length>0){
			var table = $("<table class='gridtable'/>");
			table.css({width:opts.width-25});
			table.attr("id",opts.selectId+"_table")
			var k=0;
			var tbody = $("<tbody/>");
			var thead = $("<thead/>");
			var tr = $("<tr />"); 
			if(opts.single == false){
				var td=$("<td style='width:30px'/>");
				tr.append(td);
			}
			if(opts.showFiled.filedTitle.length>0){  
				for(var i=0;i<opts.showFiled.filedTitle.length;i++){
					var td=$("<td />"); 
				 	td.append(opts.showFiled.filedTitle[i]);
				 	tr.append(td); 
				}
				thead.append(tr);
				table.append(thead);
			} 
			for(var i=0;i<opts.data.result.length;i++){
				var object1 = opts.data.result[i];
				var tr = $("<tr />"); 
				tr.data("data",object1);
				 k=0;
				if(opts.single == false){
					k++;
					var td=$("<td />");
					var ck=$("<input type='checkbox'>");
					if(checkRow(object1,opts).has==-1){
						ck=$("<input type='checkbox'>");
					}else{
						ck=$("<input type='checkbox' checked>");
					} 
					td.append(ck);
					tr.append(td);
					ck.data("data",object1); 
					ck.click({name:opts},function(){
						checkboxData($(this),opts);  
						$("#"+opts.selectId).data("data",opts.valueData);
						showContent1(opts); 
					});
				}  
				for(var u=0;u<opts.showFiled.filedTitle.length;u++){
					var td=$("<td />"); 
				 	td.append(object1[opts.showFiled.filed[u]]);  
				 	tr.append(td);  
				} 
				tbody.append(tr);
				tr.data("data",object1);
				//如果单选则tr事件，就进行选中，进行给文本框赋值操作
				if(opts.single == true){
					tr.click({name:opts},function(event){ 
						var opts = event.data.name;
						var id   =opts.idFiled;
						var name =opts.nameFiled;
						var obj =$(this).data("data");
						$("#"+opts.selectId).val(obj[name]);
						var arrayl = [];arrayl.push(obj);
						$("#"+opts.selectId).data("data",arrayl);
						if(opts.single == true){
						   $("#"+opts.selectId).unbind("focusin");
						   opts.divContent.hide(); 
						}
						opts.submit(opts);
					}); 
				}  
			} 
			
			table.append(tbody);  
			opts.content2.append("<div style='margin:5px;'><input  type='text'  placeholder='请输入查询条件' id='"+opts.selectId+"_gridselect' width='60px' value='"+_gridselect+"'><button id='"+opts.selectId+"_gridselectButton' style='margin-left:5px'>查询</button></div>");  
			opts.content2.append(table);
			if(opts.page == true){ 
				opts.content2.append(cl);  
				pagedivLister(opts,cl);
			} 
			$(cl.children()[1]).val(opts.param.start);
			$("#"+opts.selectId+"_gridselect").click({name:opts},function(event){  
				event.stopPropagation();
			}); 
			$("#"+opts.selectId+"_gridselectButton").click({name:opts},function(event){ 
				var opts = event.data.name;
				loadWebData(opts);
				showData(opts);  
			}); 
			changeColorTd(table);
		}else{
			if(opts.page == true){
				var c  =pagediv.clone();
				opts.content2.append(cl);  
				pagedivLister(opts,cl);
			} 
		}
		loadSucessTrColor(opts);
	}
	
	//显示文本的值
	function showTextValue(opts){
		var textshow ="";
		for(var i=0;i<opts.valueData.length;i++){
			if(i==opts.valueData.length-1){
				textshow+=opts.valueData[i][opts.nameFiled];
			}else{
				textshow+=opts.valueData[i][opts.nameFiled]+",";
			} 
		}
		$("#"+opts.selectId).val(textshow); 
	}
	 
	//把显示的选中的值放到第一区
	function showContent1(opts){ 
		opts.content1.html("");
	//	//console.log(opts.valueData.length);
		for(var i=0;i<opts.valueData.length;i++){
			var deletebut1 = $(deletebut).clone(); 
			opts.content1.append(deletebut1);
			var deletesvg1 =$(deletesvg).clone();
			$(deletebut1.children()[1]).append(deletesvg1); 
			deletebut1.find("div[name=div_selectCT]").text(opts.valueData[i][opts.nameFiled]);
			deletebut1.css({"margin-top":"5px","margin-left":"5px","margin-bottom":"5px"});
			deletesvg1.click({name:opts,row:opts.valueData[i]},function(event){
				var opts = event.data.name;
				var row  =event.data.row;
				var flag = checkRow(row,opts);  
				opts.valueData.splice(flag.index,1);
				if(opts.tree == true){ 
					//树取消选中
					var treeObj = $.fn.zTree.getZTreeObj(opts.selectId+"_tree");
					var nodes = treeObj.getCheckedNodes(true);
					for (var i=0, l=nodes.length; i < l; i++) { 
						if(nodes[i][opts.idFiled] == row[opts.idFiled]){
							treeObj.checkNode(nodes[i], false, false);
						} 
					} 
					showContent1(opts); 
				}else{  
					CancelCheckbox(opts);//删除一个将 
				} 
			});
		} 
	};
	
	
	//取消选中chebox
	function CancelCheckbox(opts){
			var checkbox = opts.divContent.find("input[type=checkbox]");
		for(var j=0;j<checkbox.length;j++){   
			var f1 ="false";
			var index=-1;
			var row = $(checkbox[j]).data("data"); 
			for(var i=0;i<opts.valueData.length;i++){
				if(opts.valueData[i][opts.idFiled] ==row[opts.idFiled]){
					f1 ="true" 
					break;
				} 	
			}
			if(f1=="false" && $(checkbox[j]).prop("checked") ==true){
				$(checkbox[j])[0].checked=false;
			} 
		}
		showContent1(opts); 
	} 
	//checkbox方法
	function checkboxData(ck,opts){
		var row = ck.data("data");
		var flag = checkRow(row,opts); 
		if(ck.prop("checked")==true &&flag.has==-1){
			opts.valueData.push(row);
		}
		if(ck.prop("checked")==false &&flag.has==1){
			////console.log(flag.index);
			opts.valueData.splice(flag.index,1);
		}
	} 
	//检查数字中是否有些值,flag =1 ,返回ture,则移出去这个值
	function checkRow(row,opts){
		if(opts.valueData.length==0){
			return {has:-1,index:-1};
		}
		for(var i=0;i<opts.valueData.length;i++){
			var object = opts.valueData[i];
			var  f = object[opts.idFiled];
			 if(f == row[opts.idFiled]){
				 return {has:1,index:i}; 
			 } 
		}	
		return {has:-1,index:-1};
	}
	//分页的数据调用
	function pagedivLister(opts,cl){ 
		//console.log("-------------pagedivLister-------------"+opts.selectId);
		$(cl.children()[0]).click({name:opts},function(event){  
			//console.log("up")
			var page =$(cl.children()[1]).children().val(); 
			page--;
			if(page <= 1){
				page =1;
			}
			$(cl.children()[1]).children().val(page);
			var opts =event.data.name;
			opts.param.start = page;
			loadWebData(opts);
			//$(this).unbind("click");
			showData(opts);
			
		});
		$(cl.children()[1]).keyup({name:opts},function(event){
			 
			var page =$(cl.children()[1]).children().val();
			if(event.keyCode == 13){ 
				var opts =event.data.name;
				opts.param.start = page; 
				loadWebData(opts);
				//$(this).unbind("keyup");
				showData(opts);
			} 
		});
		$(cl.children()[2]).click({name:opts},function(event){
			//console.log("next")
			var page =$(cl.children()[1]).children().val();  
			page++; 
			//console.log(page);
			$(cl.children()[1]).children().val(page);
			var opts =event.data.name;
			opts.param.start = page;
			loadWebData(opts);
			//$(this).unbind("click");
			showData(opts);
		}); 
		
	}
	var optsall;
	// 组件初始化
	$.fn.houzhuoSelect = function(method, options) {
		if (typeof (method) == "string") {
			return $.fn.houzhuoSelect.methods[method](options);
		} else {
			 optsall = $.extend({}, $.fn.houzhuoSelect.defaults, method);  
			 treesetting = {}
			 treesetting= $.extend(true, treesettingDefault,method.treesettting);
		//	 $.extend(true,object1, object2);
			$("head").append(gridStyle);
			init(optsall);
		}
	};  
	// 组件默认参数
	$.fn.houzhuoSelect.defaults = { 
		width:0,
		height:300,
		type:"get",
		single:true,
		page:false,
		idFiled:"id",
		panelpostion:"down",
	 	nameFiled:"name",
	 	showFiled:{
	 		filed:[],
	 		filedTitle:[]
	 	},
	 	valueData:[],
	 	tree:false,
	 	treesettting:{},
		param:{
			start:1,
			limit:20,
			count:0
			 
		},
		selectId:"",
		dataUrl:"",
		before:function(opts){
			console.log("组件初始化之前调用默认方法初始方法，默认未实现");
		},
		success:function(opts) {
			console.log("初始化加载完成调用默认方，默认未实现");
		},
		submit:function(opts){
			console.log("选中提交事件");
		}
	};
	// 组件方法注册
	$.fn.houzhuoSelect.methods = {
		getValues : function(selectId) { 
			return $("#"+selectId).data("data");
		},
		setValues:function(array){
			optsall.valueData = array;
			console.log(optsall.valueData);
			showData(optsall);
		}
	}; 
	
	//ztree树点击事件
	function zTreeOnClick(event, treeId, treeNode) { 
		var treeId  = event.data.treeId;
		var opts =$("#"+treeId).data("opts");
		if(opts.single == false){
	    	return;
	    }
	    $("#"+opts.selectId).data("data",treeNode);
	    $("#"+opts.selectId).unbind("focusin");
	    if(opts.single == true){
	    	$("#"+opts.selectId).val(treeNode[opts.nameFiled]);
		    opts.divContent.hide();
	    } 
	}; 
	//加载多选事件
	function zTreeOnCheck(event, treeId, treeNode) { 
		var opts =$("#"+treeId).data("opts");
		var treeObj = $.fn.zTree.getZTreeObj(treeId);
		var nodes = treeObj.getCheckedNodes(true);
		var temp = []; 
		opts.valueData = nodes;
		$("#"+opts.selectId).data("data",opts.valueData);
		showContent1(opts);
	};
	
	//计算加载完成，选中tr的颜色
	function loadSucessTrColor(opts){
		var datalist = $("#"+opts.selectId).data("data"); 
		if(!datalist){
			return;
		}
		var Listtr = $("#"+opts.selectId+"_table").find("tr"); 
		if(Listtr.length<=0){
			return;
		}
		//因 为第一行是head,所以丛1开始
		for(var i=1;i<Listtr.length;i++){  
			var object = $(Listtr[i]).data("data"); 
			for(var j=0;j<datalist.length;j++){ 
				if(object[opts.idFiled] ==datalist[j][opts.idFiled] ){
					 
					$(Listtr[i]).children().addClass("tdbackgroudn");
					continue;
				}
			}
		}
		
	}
	//改变表格颜色
	function changeColorTd(table){  
        var rows = table[0].getElementsByTagName("tr");  
        $(rows).mouseover(function () {
            $(this).addClass("evenrowcolor");
        }).mouseout(function () {
        	$(this).removeClass("evenrowcolor");
        });
         return;//以下是隔行变色代码
         for(i = 1; i < rows.length; i++){          
             if(i % 2 == 0){
                 rows[i].className = "evenrowcolor";
            }else{
                 rows[i].className = "oddrowcolor";
             }      
         }
    }
	var treesetting={
			
	};
	var treesettingDefault = {  
			data: {
				simpleData: {
					enable: true,
					idKey: "id",
					pIdKey: "pId",
					rootPId: 0
				}
			},
			callback: {
				onClick: zTreeOnClick,
				onCheck: zTreeOnCheck
			}, 
			check: {
				enable: true,
				autoCheckTrigger: true
			}
		};
	var pagediv = $('<div style="margin:5px;height:35px;"><div style="line-height: 30px;width:50px;float:left;text-align:center;background:#5BC0DE;">上一页</div>'+
	              '<div style="line-height: 30px;width:30px;float:left;width:50px;text-align:center;"><input type="text" style="width:30px;height:22px;" value="1"></div>'+
		          '<div style="line-height: 30px;width:50px;float:left;text-align:center;background:#5BC0DE;">下一页</div></div>');	
	var deletesvg =$(' <svg version="1.1" id="Ebene_1" style="margin-top:6px;cursor: pointer;" fill="green" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 	 width="20px" height="20px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve"> <g> 	<path d="M17.586,46.414C17.977,46.805,18.488,47,19,47s1.023-0.195,1.414-0.586L32,34.828l11.586,11.586 		C43.977,46.805,44.488,47,45,47s1.023-0.195,1.414-0.586c0.781-0.781,0.781-2.047,0-2.828L34.828,32l11.586-11.586 		c0.781-0.781,0.781-2.047,0-2.828c-0.781-0.781-2.047-0.781-2.828,0L32,29.172L20.414,17.586c-0.781-0.781-2.047-0.781-2.828,0 		c-0.781,0.781-0.781,2.047,0,2.828L29.172,32L17.586,43.586C16.805,44.367,16.805,45.633,17.586,46.414z"/> 	<path d="M32,64c8.547,0,16.583-3.329,22.626-9.373C60.671,48.583,64,40.547,64,32s-3.329-16.583-9.374-22.626 		C48.583,3.329,40.547,0,32,0S15.417,3.329,9.374,9.373C3.329,15.417,0,23.453,0,32s3.329,16.583,9.374,22.626 		C15.417,60.671,23.453,64,32,64z M12.202,12.202C17.49,6.913,24.521,4,32,4s14.51,2.913,19.798,8.202C57.087,17.49,60,24.521,60,32 		s-2.913,14.51-8.202,19.798C46.51,57.087,39.479,60,32,60s-14.51-2.913-19.798-8.202C6.913,46.51,4,39.479,4,32 		S6.913,17.49,12.202,12.202z"/> </g> </svg> ');
	var deletebut =$('<div style="height:35px;line-height:35px;background:#F0AD4E;max-width:250px;float:left;"> <div style="height:35px;line-height:35px;float:left;max-width:220px;"> <div style="margin-left:5px;height:35px;line-height:35px;max-width:210px;word-break: break-all;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" name="div_selectCT"></div> </div> <div style="height:35px;line-height:35px;float:left;background:#D6E9C6;width:30px;text-align: center;"> </div> </div>');
	var gridStyle =$('<style type="text/css"> table.gridtable {     font-family: verdana,arial,sans-serif;     font-size:11px;     color:#333333;     border-width: 1px;     border-color: #666666;     border-collapse: collapse; background:#ffffff;} table.gridtable th {     border-width: 1px;     padding: 8px;     border-style: solid;     border-color: #666666;     background-color: #dedede; } table.gridtable td {     border-width: 1px;     padding: 8px;     border-style: solid;     border-color: #666666;} .oddrowcolor{background-color:#d4e3e5;} .evenrowcolor{background-color:#c3dde0;}.tdbackgroudn{background-color:yellow;}</style>');
	 
})();